<template>
  <div>
    <child :name="name" age="20" @onSetName="setName"></child>
  </div>
</template>

<script>
import child from '@/components/child.vue'

export default {
  components: {
    child
  },
  data() {
    return {
      name: '张三'
    }
  },
  methods: {
    setName(name) {
      this.name = name
    }
  }
}
</script>

<style lang="scss"></style>
